import Router from "koa-router";

const router = new Router();

// id 为可选参数
router.get("/:id?", (ctx, next) => {
    const userId = ctx.params.id;
    ctx.body = "routes/users.js --> get --> /" + `, 参数id:  ${userId}`;
});

router.get("/login", (ctx, next) => {
    ctx.body = "routes/users.js --> get --> /login";
});

router.get("/logout", (ctx, next) => {
    ctx.body = "routes/users.js --> get --> /logout";
});

export default router;
